<html>
<head>
    <script>
    function runTest() {
        if (window.testRunner)
            testRunner.dumpAsText();
        else {
            alert('This test does not work in Safari.');
            return;
        }
            
        onblurCalled = false;

        // Simulate a tab. 
        eventSender.keyDown('\t', new Array());

        if (onblurCalled)
            return;
        
        document.getElementById('result').innerHTML = 'SUCCESS';        
    }
    </script>
</head>
<body onload="runTest()">
    <input type="text" onfocus="this.setAttribute('type', 'password')" onblur="onblurCalled = true;">
    <p>
    This tests that changing an input element's type in its onfocus handler does not cause its onblur handler to be called. If this test is successful, "SUCCESS" should be shown below.
    </p>
    <div id="result">FAILURE</div>
</body>
</html>
